
#ifdef WIN32
#include <Windows.h>
#endif

#include <occi.h> 

using namespace oracle::occi;
using oracle::occi::Statement;
using oracle::occi::ResultSet;
using oracle::occi::Connection;
using oracle::occi::MetaData;

#include "oracle_common.hpp"
 
namespace topdbs
{
	OraCursor::OraCursor():
		m_stmt(nullptr),
		m_resultset(nullptr),
		m_connection_ptr(nullptr)
	{
	}

	OraCursor::~OraCursor()
	{
		if(m_stmt)
		{
			if(m_resultset)
			{
				m_stmt->closeResultSet(m_resultset);
			}		
			m_connection_ptr->terminateStatement(m_stmt);	
		}	
	}

	OraStatement::OraStatement():
		m_stmt(nullptr),
		m_resultset(nullptr),
		m_connection_ptr(nullptr)
	{
	}

	OraStatement::~OraStatement()
	{
		if(m_stmt)
		{
			if(m_resultset)
			{
				m_stmt->closeResultSet(m_resultset);
			}		
			m_connection_ptr->terminateStatement(m_stmt);	
		}
	}
}

